package com.wake.lottie

import android.content.Context
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.rememberLottieComposition


/**
 *@author created by WA03675
 *@date  2022-04-20 16:18
 *@des
 */

@Composable
fun MyLottieLoadView(
    context: Context,
    path: String,
    modifier: Modifier = Modifier,
    iteration: Int = 10
) {

    val composition by rememberLottieComposition(LottieCompositionSpec.Asset(path))
    LottieAnimation(
        composition = composition,
        modifier = modifier.defaultMinSize(300.dp),
        iterations = iteration)

}